import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int count=0;
        for(int i=2;i<=n;i++){
            int sum=0;
            for(int j=2;j*j<=i;j++){
                if(i%j==0){
                    if(i/j==j){
                        sum+=j;
                    }else{
                        sum=sum+j+i/j;
                    }
                }
            }
            if(sum+1==i){
                count++;
            }
        }
        System.out.println(count);
    }
}
